package cn.lopr.im.socketserver.client;

import java.net.URI;
import java.net.URISyntaxException;

/**
 * @author shuangyang7
 * @date 2020/12/19 10:23
 */
public class ClientDemo {
    public static void main(String[] args) {

        IMSocketClient socketClient = null;
        try {
            //socketClient = new IMSocketClient(new URI("ws://home.lopr.cn:31360"));
            socketClient = new IMSocketClient(new URI("ws://localhost:1024"));
            //while (!socketClient.getReadyState().equals(OPEN)) {
            //    System.out.println("还没有打开");
            //}
            socketClient.connectBlocking();

            socketClient.
                    send("{\"date\":\"2021-05-14 10:36:03\",\"fromUser\":\"18255431887\",\"isRead\":0,\"msg\":\"sss11\",\"toUser\":\"18255431884\",\"type\":3}");
        } catch (URISyntaxException e) {
            e.printStackTrace();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
